Skip to content

[DRAFT] Integrate spec-driven development workflow#2213

Draft
leonardomendix wants to merge 1 commit into
mainfrom
chore/openspec-v1
Draft

[DRAFT] Integrate spec-driven development workflow#2213
leonardomendix wants to merge 1 commit into
mainfrom
chore/openspec-v1

Conversation

@leonardomendix
Copy link
Copy Markdown
Collaborator

Pull request type

No code changes (changes to documentation, CI, metadata, etc.)


Description

Sets up OpenSpec for spec-driven widget development. Introduces per-widget openspec directories alongside a custom mendix-widget schema and tool-agnostic agent rules.

What's included:

  • config.yaml — monorepo-level context (Mendix API patterns, tech stack, per-artifact rules)
  • mendix-widget — custom schema with 4 Mendix-aware artifact templates (proposal, spec, design, tasks) and correct dependency order
  • spec.md — shared widget development conventions as a formal spec (ActionValue guard, XML alignment, semver, Atlas UI, testing)
  • mendix-widget.md — concise, tool-agnostic coding rules for any AI coding assistant
  • Pilot widgets initialized: datagrid-web, combobox-web, gallery-web — each with config.yaml, brownfield baseline specs/spec.md, and per-widget AGENTS.md
  • @fission-ai/openspec added to root devDependencies

Agent files updated:

  • AGENTS.md — OpenSpec workflow section with per-widget init convention
  • CLAUDE.mdspec.md + schema auto-loaded


## API Guards

- ALWAYS check `actionValue.canExecute` before calling `execute()`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a utility function that does this, maybe we could refer that too.

Copy link
Copy Markdown
Collaborator

@iobuhov iobuhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main question - how openspec going to work per package?

Comment thread openspec/config.yaml
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use default schema for now. This context is very widget specific and we probably should make a skill out of it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file needs splitting. We probably should create ~/.agents/conventions as conventions is subject to change. We can use this spec as a pointer to our conventions files.

Comment thread openspec/README.md
/opsx:archive
```

## Structure
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not final structure, so I would avoid this section for now.

@iobuhov
Copy link
Copy Markdown
Collaborator

iobuhov commented May 13, 2026

I like the idea of mendix-widget schema

@iobuhov
Copy link
Copy Markdown
Collaborator

iobuhov commented May 13, 2026

Main question - how openspec going to work per package?

We can use openspec cii to init each widget with (--tools none)

Comment on lines +5 to +8
- ALWAYS check `actionValue.canExecute` before calling `execute()`
- NEVER render widget content while value status is `"loading"` — show loading/placeholder state instead
- Use `editableValue.setValue()` for two-way binding, never mutate the value directly
- Handle all three `EditableValue` states: `"available"`, `"loading"`, `"unavailable"`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a skill candidate - how to work with Mendix PW API.

Comment on lines +12 to +14
- XML property keys MUST be lowerCamelCase and MUST match TypeScript prop names exactly
- When adding an XML property: update `<Widget>.xml`, rebuild to regenerate `typings/<Widget>Props.d.ts`, update `editorConfig.ts`, and `editorPreview.tsx`
- Each widget MUST have a unique widget ID in `package.xml` — never duplicate across widgets
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a skill candidate - how to work with Properties XML

@gjulivan gjulivan force-pushed the chore/openspec-v1 branch from da0b198 to 1593240 Compare May 21, 2026 08:43
Comment on lines +26 to +32
#### Scenario: XML property renamed

- GIVEN a developer renames an existing XML property
- WHEN the change is merged
- THEN the TypeScript prop name MUST be updated to match the new XML key
- AND all usages of the old prop name in `.tsx` and `editorConfig.ts` MUST be updated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We almost never rename properties, because it is a breaking change.

  • We change captions sometimes, but this doesn't change their typings.
  • We rarely change property types, this needs a really special case.

#### Scenario: New XML property added

- GIVEN a developer adds a new property to `<WidgetName>.xml`
- WHEN the property has any supported Mendix type (string, integer, boolean, action, attribute, datasource, etc.)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding unsupported types should not be even an option 🤔

Comment on lines +16 to +17
Widget XML property keys SHALL use lowerCamelCase and MUST match the corresponding
TypeScript prop names exactly.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xml leads, typings is a compilation byproduct, we probably should not mention this. Flow should be simple: adjust XML -> compile typings, done.

- GIVEN a widget has an `ActionValue` prop
- WHEN a user triggers the action (click, keypress, programmatic trigger)
- THEN the widget MUST verify `canExecute === true` before calling `execute()`
- AND if `canExecute` is false, the interaction SHALL be silently ignored or the trigger element disabled
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads that it should be disabled after user clicks it once, should be the opposite: If and action is tied to a UI element directly (most of the cases it is not, I believe), then UI element should be disabled in the first place.


context: |
Widget: combobox-web (Combo Box)
Version: 2.8.0 | Min Mendix: 10.22.0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to mention version here? It is readable from package.json and we will forget to update it here on new releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants